<link rel="stylesheet" type="text/css" media="all" href="skins/aqua/theme.css" title="Aqua" />
<style type="text/css">
<!--
.Estilo4 {	color: #990000;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 2;
	font-weight: bold;
}
.Estilo5 {	color: #000000;
	font-size: 14px;
}
.Estilo6 {color: #FF0000}
.Estilo8 {font-size: 9px}
-->
</style>
<script language="javascript" src="WYSIWYG/source.js" type="text/javascript">
</script>
<!-- import the calendar script -->
<script type="text/javascript" src="calendar.js"></script>

<!-- import the language module -->
<script type="text/javascript" src="lang/calendar-en.js"></script>

<!-- helper script that uses the calendar -->
<script type="text/javascript">function selected(cal, date) {
  cal.sel.value = date; // just update the date in the input field.
  if (cal.dateClicked && (cal.sel.id == "sel1" || cal.sel.id == "sel3"))
    cal.callCloseHandler();
}
function closeHandler(cal) {
  cal.hide();                        // hide the calendar
//  cal.destroy();
  _dynarch_popupCalendar = null;
}
function showCalendar(id, format, showsTime, showsOtherMonths) {
  var el = document.getElementById(id);
  if (_dynarch_popupCalendar != null) {
    // we already have some calendar created
    _dynarch_popupCalendar.hide();                 // so we hide it first.
  } else {
    // first-time call, create the calendar.
    var cal = new Calendar(1, null, selected, closeHandler);
    // uncomment the following line to hide the week numbers
    // cal.weekNumbers = false;
    if (typeof showsTime == "string") {
      cal.showsTime = true;
      cal.time24 = (showsTime == "24");
    }
    if (showsOtherMonths) {
      cal.showsOtherMonths = true;
    }
    _dynarch_popupCalendar = cal;                  // remember it in the global var
    cal.setRange(1900, 2070);        // min/max year allowed.
    cal.create();
  }
  _dynarch_popupCalendar.setDateFormat(format);    // set the specified date format
  _dynarch_popupCalendar.parseDate(el.value);      // try to parse the text in field
  _dynarch_popupCalendar.sel = el;                 // inform it what input field we use
  _dynarch_popupCalendar.showAtElement(el.nextSibling, "Br");        // show the calendar

  return false;
}

var MINUTE = 60 * 1000;
var HOUR = 60 * MINUTE;
var DAY = 24 * HOUR;
var WEEK = 7 * DAY;

function isDisabled(date) {
  var today = new Date();
  return (Math.abs(date.getTime() - today.getTime()) / DAY) > 10;
}

function flatSelected(cal, date) {
  var el = document.getElementById("preview");
  el.innerHTML = date;
}

function showFlatCalendar() {
  var parent = document.getElementById("display");
  var cal = new Calendar(0, null, flatSelected);
  cal.weekNumbers = false;

  cal.setDisabledHandler(isDisabled);
  cal.setDateFormat("%A, %B %e");

  cal.create(parent);

  cal.show();
}

function compare_dates(fecha, fecha2){  
    var xMonth=fecha.substring(3, 5);  
    var xDay=fecha.substring(0, 2);  
    var xYear=fecha.substring(6,10);  
    var yMonth=fecha2.substring(3, 5);  
    var yDay=fecha2.substring(0, 2);  
    var yYear=fecha2.substring(6,10);  
    if (xYear> yYear){  
        return(true)  
    }  
    else{  
      if (xYear == yYear){   
        if (xMonth> yMonth){  
            return(true)  
        }  
        else{   
          if (xMonth == yMonth){  
            if (xDay> yDay)  
              return(true);  
            else  
              return(false);  
          }  
          else  
            return(false);  
        }  
      }  
      else  
        return(false);  
    }  
}
function reporte(){ 
	var dia, mes, anio,fecha;
	if(document.form1.fecini.value != ""){
		fecha = document.form1.fecini.value;
		dia  =  fecha.substring(0,2);
        mes  =  fecha.substring(3,5);
        anio =  fecha.substring(6);
		document.form1.fecini.value = anio+"-"+mes+"-"+dia;		
	}
	if(document.form1.fecfin.value != ""){
		fecha = document.form1.fecfin.value;
		dia  =  fecha.substring(0,2);
       	mes  =  fecha.substring(3,5);
       	anio =  fecha.substring(6);
		document.form1.fecfin.value = anio+"-"+mes+"-"+dia;
	}	
	/*Se verifica el Reporte a Mostrar*/
	if(document.form1.comentarios.checked) {
		document.form1.action= "ReporteNoticiaComentarios.php";
		document.form1.submit();
	}else{
		document.form1.action= "ReporteNoticia.php";
		document.form1.submit();
		
		}
}
function periodico(){ 
	var dia, mes, anio,fecha;
	if(document.form1.fecini.value != ""){
		fecha = document.form1.fecini.value;
		dia  =  fecha.substring(0,2);
        mes  =  fecha.substring(3,5);
        anio =  fecha.substring(6);
		document.form1.fecini.value = anio+"-"+mes+"-"+dia;		
	}
	if(document.form1.fecfin.value != ""){
		fecha = document.form1.fecfin.value;
		dia  =  fecha.substring(0,2);
       	mes  =  fecha.substring(3,5);
       	anio =  fecha.substring(6);
		document.form1.fecfin.value = anio+"-"+mes+"-"+dia;
	}	
	document.form1.action= "periodico.php";
	document.form1.submit();
}
</script>
<TABLE height="86%" width=547 align=center bgColor=#ffffff border=0>
     <TR>
      <TD vAlign=top width=543 bgColor=#ff0000 height="100%">
	  		<form name="form1" method="post" >
        <TABLE height="401%"  width=541 align=center border=0>       
            <TR>
              <TD width="537" height="369" vAlign=top bgColor=#ffffff><DIV align=center>
                <p>&nbsp;</p>
                <DIV align=center class="Estilo4">
                  <p class="Estilo5">Reporte de Noticias </p>
                  <p class="Estilo5">&nbsp;</p>
                  <p class="Estilo5 Estilo6">_________________________________________________</p>
                </DIV>
                <TABLE height="45%" cellSpacing=5 width=437 align=center bgColor=#ffffff border=0>
                  <TBODY>
                    <TR>
                      <TD width=425 bgColor=#ffffff height="198">                      
                        <table width="450">
                                <tr>
                                  <td width="210">Publicado:</td>
                                  <td width="185"><label>
                                    <input name="publicado" type="radio" value="0" checked>
                                    Si</label>
                                      <label>
                                      <input name="publicado" type="radio" value="1">
                                        No</label>
									 <label>
                                      <input name="publicado" type="radio" value="2">
                                        Todos</label></td>
                                </tr>
                                <tr>
                                  <td height="22"><p>Nivel de Acceso:</p></td>
                                  <td><label>
                                    <select name="nivel" id="nivel" >
                                      <option value="0">P&uacute;blico</option>
                                      <option value="1">Consejo Comunal</option>
                                      <option value="2">Habitante</option>
                                    </select>
                                  </label></td>
                                </tr>

                                <tr>
                                  <td>Fecha de Inicio de Publicaci&oacute;n: </td>
                                  <td><input type="text" name="fecini" id="sel3" size="20" readonly="readonly" ><input name="reset" type="reset"
onClick="return showCalendar('sel3', '%d-%m-%Y');" value=" ... ">                                  </td>
                                </tr>
                                <tr>
                                  <td>Fecha Fin de Publicaci&oacute;n: </td>
                                  <td><input type="text" name="fecfin" id="sel4" size="20" readonly="readonly" ><input name="reset" type="reset"
onClick="return showCalendar('sel4', '%d-%m-%Y');" value=" ... ">                                  </td>
                                </tr>
								<tr>
								<td>Reporte con Comentarios</td>
								<td>
								<input type="checkbox" name="comentarios" value="1" >
                                    </td>
								</tr>
                        </table>      
						<br />                  
                            <table width="403" align="center">
                                <tr>
                                  <td width="179" height="26" align="center"><img  src="descarga.jpg" width="42" height="41" alt="Imprimir Periodico" onClick="periodico()" ></td>
                                  <td width="212" align="center"><div align="right"><img  src="reporte.jpg" width="42" height="41" alt="Imprimir Reporte" onClick="reporte()" >
							        </td>
                                </tr>
                        </table>
                      </TD>
                    </TR>                
                </TABLE>
              </DIV></TD>
            </TR>  
        </TABLE>        
      </form>
    </TR>
 </TBODY>
</TABLE>

